// ----------------------------------------------------------------------------
// serialize_instance_member.h
// ----------------------------------------------------------------------------
#pragma once
#include <fw/base/serialize/serialize_member.h>
#include <fw/base/runtime/hash.h>

namespace fw
{
	class SerializeSchema;
	class SerializeCompoundType;
	class SerializeAllocator;
	class ByteWriter;
	class ByteReader;
	
	class SerializeInstanceMember : public SerializeMember
	{
	public:
		SerializeInstanceMember(int count, Hash typeName);
		
		virtual size_t					GetSize			() const;
		virtual size_t					GetAlignment	() const;
		virtual int						GetPointerCount	(const char* scopeData, int index) const;
		virtual const SerializeType*	PreFixUp		(SerializeSchema& schema, Hash typeName);
		virtual void					Convert			(char*					dstData,
														 const char*			srcData,
														 const SerializeMember&	srcMember,
														 SerializeAllocator&	alloc) const;
		virtual void					Write			(ByteWriter& writer) const;
		static SerializeInstanceMember* ReadNew			(ByteReader& reader);
		
	}; // class SerializeInstanceMember
	
} // namespace fw
